<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2019. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <title>
      Java Compiler Preferences
    </title>
    <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
    <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> </script>
  </head>
  <body>
    <h1>
      Java Compiler Preferences
    </h1>
    <p>The
    <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.CompliancePreferencePage)")'>
    <img src="PLUGINS_ROOT/org.eclipse.help/command_link.svg" alt="Opens the Java Compiler preference page">
    <b>Java &gt; Compiler</b></a> preference page
    lets you configure the various settings related to compiling of Java source code and class file generation.</p>
    <p>An Eclipse-based product may change the compiler defaults, so they may be different than the ones indicated here.</p>
<p>Sub pages offer more compiler settings:</p>
 <ul>
  <li><a href="compiler/ref-preferences-building.htm">Building</a></li>
  <li><a href="compiler/ref-preferences-errors-warnings.htm">Error/Warnings</a></li>
  <li><a href="compiler/ref-preferences-javadoc.htm">Javadoc</a></li>
  <li><a href="compiler/ref-preferences-task-tags.htm">Task Tags</a></li>
 </ul>
 
<p>The options are:</p>

<h3>JDK Compliance</h3>
    <table border="1" cellspacing="0" cellpadding="5" width="100%" summary="JDK Compliance">
      <tr>
        <th>
          <p>
            Option
          </p>
        </th>
        <th>
          <p>
            Description
          </p>
        </th>
        <th>
          <p>
            Default
          </p>
        </th>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Compiler compliance level
          </p>
        </td>
        <td valign="top">
          <p>
            Specifies the compiler compliance level.
          </p>
        </td>
        <td valign="top">
          <p>
            Depends on default JRE
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Use --release option
          </p>
        </td>
        <td valign="top">
          <p>
            If Selected, the system libraries from the selected compiler compliance level will be used with the '--release' compiler option using the current JRE.
            This option is valid, if the JRE being used is 9 or above and the compiler compliance is 1.6 or above. 
          </p>
        </td>
        <td valign="top">
          <p>
            Depends on default JRE
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Use default compliance settings
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, the default compliance settings for the compiler compliance level are applied.
          </p>
        </td>
        <td valign="top">
          <p>
            On
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Enable preview features
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, the compiler will activate the preview language features of the Java version in use.
          </p>
        </td>
        <td valign="top">
          <p>
            Off
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Preview features with severity level
          </p>
        </td>
        <td valign="top">
          <p>
            When enabled, the compiler will issue a warning when a preview language feature is used.
          </p>
        </td>
        <td valign="top">
          <p>
            Warning
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Generated class files compatibility
          </p>
        </td>
        <td valign="top">
          <p>
            Specifies the generated class file compatibility.
          </p>
        </td>
        <td valign="top">
          <p>
            Depends on default JRE
          </p>
        </td>
      </tr>
        <tr>
        <td valign="top">
          <p>
            Source compatibility
          </p>
        </td>
        <td valign="top">
          <p>
            Specifies the compatibility of the accepted source code.
          </p>
        </td>
        <td valign="top">
          <p>
            Depends on default JRE
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Disallow identifiers called 'assert'
          </p>
        </td>
        <td valign="top">
          <p>
            When enabled, the compiler will issue an error or a warning whenever 'assert' is used as an identifier (reserved keyword in J2SE 1.4).
          </p>
        </td>
        <td valign="top">
          <p>
            Warning
          </p>
        </td>
      </tr>
            <tr>
        <td valign="top">
          <p>
            Disallow identifiers called 'enum'
          </p>
        </td>
        <td valign="top">
          <p>
            When enabled, the compiler will issue an error or a warning whenever 'enum' is used as an identifier (reserved keyword in J2SE 1.5).
          </p>
        </td>
        <td valign="top">
          <p>
            Warning
          </p>
        </td>
      </tr>
          </table>
          <h3>Classfile generation</h3>
           <table border="1" cellspacing="0" cellpadding="5" width="100%" summary="Classfile generation">   
      <tr>
        <td valign="top">
          <p>
            Add variable attributes to generated class files
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, variable attributes are added to the class file. This will enable local variable names to be displayed in the debugger (in places where variables are
            definitely assigned) The resulting .class file is then bigger.
          </p>
        </td>
        <td valign="top">
          <p>
            On
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Add line number attributes to generated class files
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, line number information is added to the class file. This will enable source code highlighting in the debugger.
          </p>
        </td>
        <td valign="top">
          <p>
            On
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Add source file name to generated class file
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, the source file name is added to the class file. This will enable the debugger to present the corresponding source code.
          </p>
        </td>
        <td valign="top">
          <p>
            On
          </p>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <p>
            Preserve unused local variables
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, unused local variables (i.e. never read) are not stripped from the class file. If stripped this potentially alters debugging.
          </p>
        </td>
        <td valign="top">
          <p>
            On
          </p>
        </td>
      </tr>
       <tr>
        <td valign="top">
          <p>
            Inline finally blocks
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, finally blocks are inlined in the generated class files. This positively affects performance, but may result in larger class files.
          </p>
        </td>
        <td valign="top">
          <p>
            Off
          </p>
        </td>
      </tr>      
      <tr>
        <td valign="top">
          <p>
            Store information about method parameters
          </p>
        </td>
        <td valign="top">
          <p>
            If enabled, information about method parameters is stored in the generated class files.
          </p>
        </td>
        <td valign="top">
          <p>
            Off
          </p>
        </td>
      </tr>
    </table>
    <h3 class="related">Related concepts</h3>
      <a href="../../../concepts/concept-java-builder.htm">Java builder</a>
    <h3 class="related">Related tasks</h3>
       <a href="../../../tasks/tasks-JREs.htm">Working with JREs</a>
    <h3 class="related">Related references</h3>
      <a href="buildpath/ref-preferences-classpath-variables.htm">Classpath variables preferences</a><br>
	  <a href="../../../reference/ref-properties-build-path.htm">Java build path properties</a><br>
	  <a href="compiler/ref-preferences-building.htm">Building preference page</a><br>
	  <a href="compiler/ref-preferences-errors-warnings.htm">Errors/Warnings preference page</a><br>
	  <a href="compiler/ref-preferences-javadoc.htm">Javadoc preference page</a><br>
	  <a href="../../../reference/preferences/java/compiler/ref-preferences-task-tags.htm">Task tags preference page</a>
  </body>
</html>

